home *** CD-ROM | disk | FTP | other *** search
/ Chip 2006 July / CHIP 2006-07.2.iso / program / web_gelistirme / easyphp1-7_setup.exe / {app} / phpmyadmin / footer.inc.php < prev    next >
Encoding:
PHP Script  |  2003-09-07  |  6.0 KB  |  148 lines

  1. <?php
  2. /* $Id: footer.inc.php,v 1.30 2003/07/10 11:40:20 nijel Exp $ */
  3. // vim: expandtab sw=4 ts=4 sts=4:
  4.  
  5. // In this file you may add PHP or HTML statements that will be used to define
  6. // the footer for phpMyAdmin pages.
  7.  
  8. /**
  9.  * Query window
  10.  */
  11.  
  12. // If query window is wanted and open, update with latest selected db/table.
  13. if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
  14. ?>
  15. <script type="text/javascript">
  16. <!--
  17. <?php
  18.     if ($cfg['QueryFrameDebug']) {
  19.     ?>
  20.         document.writeln("Updating query window. DB: <?php echo (isset($db) ? addslashes($db) : 'FALSE'); ?>, Table: <?php echo (isset($table) ? addslashes($table) : 'FALSE'); ?><br>");
  21.         document.writeln("Window: " + parent.frames.queryframe.querywindow.location + "<br>");
  22.     <?php
  23.     }
  24.     ?>
  25.     
  26.     <?php
  27.     if (!isset($error_message) || $error_message == '') {
  28.     ?>
  29.     if (parent.frames.queryframe && parent.frames.queryframe.document && parent.frames.queryframe.document.queryframeform) {
  30.         parent.frames.queryframe.document.queryframeform.db.value = "<?php echo (isset($db) ? addslashes($db) : ''); ?>";
  31.         parent.frames.queryframe.document.queryframeform.table.value = "<?php echo (isset($table) ? addslashes($table) : ''); ?>";
  32.     }
  33.     <?php
  34.     }
  35.     ?>
  36.     
  37.     function reload_querywindow () {
  38.         if (parent.frames.queryframe && parent.frames.queryframe.querywindow && !parent.frames.queryframe.querywindow.closed && parent.frames.queryframe.querywindow.location) {
  39.             <?php echo ($cfg['QueryFrameDebug'] ? 'document.writeln("<a href=\'#\' onClick=\'parent.frames.queryframe.querywindow.focus(); return false;\'>Query Window</a> can be updated.<br>");' : ''); ?>
  40.     
  41.             <?php
  42.             if (!isset($error_message) || $error_message == '') {
  43.             ?>
  44.             if (!parent.frames.queryframe.querywindow.document.sqlform.LockFromUpdate || !parent.frames.queryframe.querywindow.document.sqlform.LockFromUpdate.checked) {
  45.                 parent.frames.queryframe.querywindow.document.querywindow.db.value = "<?php echo (isset($db) ? addslashes($db) : '') ?>";
  46.                 parent.frames.queryframe.querywindow.document.querywindow.query_history_latest_db.value = "<?php echo (isset($db) ? addslashes($db) : '') ?>";
  47.                 parent.frames.queryframe.querywindow.document.querywindow.table.value = "<?php echo (isset($table) ? addslashes($table) : '') ?>";
  48.                 parent.frames.queryframe.querywindow.document.querywindow.query_history_latest_table.value = "<?php echo (isset($table) ? addslashes($table) : '') ?>";
  49.         
  50.                 <?php echo (isset($sql_query) ? 'parent.frames.queryframe.querywindow.document.querywindow.query_history_latest.value = "' . urlencode($sql_query) . '";' : '// no sql query update') . "\n"; ?>
  51.         
  52.                 <?php echo ($cfg['QueryFrameDebug'] ? 'alert(\'Querywindow submits. Last chance to check variables.\');' : '') . "\n"; ?>
  53.                 parent.frames.queryframe.querywindow.document.querywindow.submit();
  54.             }
  55.             <?php
  56.             } else {
  57.             ?>
  58.             // no submit, query was invalid
  59.             <?php
  60.             }
  61.             ?>
  62.         }
  63.     }
  64.  
  65.     function focus_querywindow(sql_query) {
  66.         if (parent.frames.queryframe && parent.frames.queryframe.querywindow && !parent.frames.queryframe.querywindow.closed && parent.frames.queryframe.querywindow.location) {
  67.             if (parent.frames.queryframe.querywindow.document.querywindow.querydisplay_tab != 'sql') {
  68.                 parent.frames.queryframe.querywindow.document.querywindow.querydisplay_tab.value = "sql";
  69.                 parent.frames.queryframe.querywindow.document.querywindow.query_history_latest.value = sql_query;
  70.                 parent.frames.queryframe.querywindow.document.querywindow.submit();
  71.                 parent.frames.queryframe.querywindow.focus();
  72.             } else {
  73.                 parent.frames.queryframe.querywindow.focus();
  74.             }
  75.  
  76.             return false;
  77.         } else if (parent.frames.queryframe) {
  78.             new_win_url = 'querywindow.php?sql_query=' + sql_query + '&<?php echo PMA_generate_common_url(isset($db) ? addslashes($db) : '', isset($table) ? addslashes($table) : '', '&'); ?>';
  79.             parent.frames.queryframe.querywindow=window.open(new_win_url, '','toolbar=0,location=1,directories=0,status=1,menubar=0,scrollbars=yes,resizable=yes,width=<?php echo $cfg['QueryWindowWidth']; ?>,height=<?php echo $cfg['QueryWindowHeight']; ?>');
  80.     
  81.             if (!parent.frames.queryframe.querywindow.opener) {
  82.                parent.frames.queryframe.querywindow.opener = parent.frames.queryframe;
  83.             }
  84.  
  85.             // reload_querywindow();
  86.             return false;
  87.         }
  88.     }
  89.  
  90.     reload_querywindow();
  91. <?php
  92. if (isset($focus_querywindow) && $focus_querywindow == "true") {
  93. ?>
  94.     if (parent.frames.queryframe && parent.frames.queryframe.querywindow && !parent.frames.queryframe.querywindow.closed && parent.frames.queryframe.querywindow.location) {
  95.         self.focus();
  96.     }
  97. <?php
  98. }
  99. ?>
  100.  
  101. //-->
  102. </script>
  103. <?php
  104. }
  105.  
  106.  
  107. /**
  108.  * Close MySql non-persistent connections
  109.  */
  110. if (isset($GLOBALS['dbh']) && $GLOBALS['dbh']) {
  111.     @mysql_close($GLOBALS['dbh']);
  112. }
  113. if (isset($GLOBALS['userlink']) && $GLOBALS['userlink']) {
  114.     @mysql_close($GLOBALS['userlink']);
  115. }
  116. ?>
  117.  
  118. </body>
  119.  
  120. </html>
  121. <?php
  122.  
  123. /**
  124.  * Generates profiling data if requested
  125.  */
  126. if (isset($GLOBALS['cfg']['DBG']['enable']) 
  127.         && $GLOBALS['cfg']['DBG']['enable'] 
  128.         && isset($GLOBALS['cfg']['DBG']['profile']['enable']) 
  129.         && $GLOBALS['cfg']['DBG']['profile']['enable']) {
  130.     //run the basic setup code first
  131.     include('./libraries/dbg/setup.php');
  132.     //if the setup ran fine, then do the profiling
  133.     if (isset($GLOBALS['DBG']) && $GLOBALS['DBG']) {
  134.         include('./libraries/dbg/profiling.php');
  135.         dbg_dump_profiling_results();
  136.     }
  137. }
  138.  
  139. /**
  140.  * Sends bufferized data
  141.  */
  142. if (isset($GLOBALS['cfg']['OBGzip']) && $GLOBALS['cfg']['OBGzip']
  143.         && isset($GLOBALS['ob_mode']) && $GLOBALS['ob_mode']) {
  144.     PMA_outBufferPost($GLOBALS['ob_mode']);
  145. }
  146.  
  147. ?>
  148.